<extend name="Public/base"/>
<block name="style">
<style type="text/css">
    .sent-margin{padding:50px;}
</style>
</block>
<block name="body">
<div class="am-cf am-u-md-12 sent-margin">
    <h1><i class="am-icon-btn am-danger am-icon-check"></i> 抱歉,出错啦!</h1>
    <p class="error">
        <?php echo($error); ?></p>
    <p class="detail"></p>
    <p class="jump"> <b id="wait"><?php echo($waitSecond); ?></b>
        秒后页面将自动跳转
    </p>
    <div>
        <a id="href" class="am-btn am-btn-primary" id="btn-now" href="<?php echo($jumpUrl); ?>">立即跳转</a>
        <button id="btn-stop" class="am-btn am-btn-default" type="button" onclick="stop()">停止跳转</button>
        <a id="href" class="am-btn am-btn-success" id="btn-now" href="<?php echo(U('Public/logout')); ?>">重新登录</a>
    </div>
</div>
<script type="text/javascript">
(function(){
 var wait = document.getElementById('wait'),href = document.getElementById('href').href;
 var interval = setInterval(function(){
        var time = --wait.innerHTML;
        if(time <= 0) {
            location.href = href;
            clearInterval(interval);
        };
     }, 1000);
  window.stop = function (){
         console.log(111);
            clearInterval(interval);
 }
 })();
</script>
</block>